#include <iostream>
#include <cstring>
using namespace std;

signed main()
{
    int n,num = 0;
    cin>>n;
    double sum = 0,t;
    for(int i=0;i<n;i++){
        char s[1000],p[1000];
        scanf("%s",s);
        sscanf(s,"%lf",&t);
        sprintf(p,"%.2f",t);
        int flag = 1;
        for(int i=0;i<strlen(s);i++){
            if(s[i]!=p[i]){
                flag = 0;
                break;
            }
        }
        sscanf(p,"%lf",&t);
        if(t<-1000||t>1000||!flag){
            printf("ERROR: %s is not a legal number\n",s);
            continue;
        }
        sum += t;
        num++;
    }
    if(num==1)    printf("The average of 1 number is %.2f\n",sum/num);
    else if(num>1)    printf("The average of %d numbers is %.2f\n",num,sum/num);
    else    printf("The average of 0 numbers is Undefined\n");
    return 0;
}
